package com.cenwangkeji.zhihuimuye.ui.activity;


import android.content.Intent;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;
import com.cenwangkeji.zhihuimuye.R;
import com.lws.basic.base.BaseActivity;
import com.lws.basic.utils.common.MyToast;
import com.lws.basic.utils.common.UIUtils;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 登录界面
 */
public class LogInActivity extends BaseActivity {

    @BindView(R.id.et_phone)
    EditText mEtPhone;
    @BindView(R.id.et_password)
    EditText mEtPassword;
    @Override
    public int setLayoutId() {
        return R.layout.activity_log_in;
    }

    @Override
    public void initData() {
        super.initData();
        ButterKnife.bind(this);
        UIUtils.setTransparentForWindow(getWindow(),true );

    }

    //登录
   protected void login(){
       String phone = mEtPhone.getText().toString().trim();
       String password = mEtPassword.getText().toString();
       Intent intent = new Intent(this,MainActivity.class);
       if (phone.equals("admin")){
           intent.putExtra("data",1 );
           startActivity(intent);
       }else {
           intent.putExtra("data",2 );
           startActivity(intent);
       }
       MyToast.show("登录成功");
       finish();



    }

    @OnClick(R.id.btn_login)
    public void onViewClicked(View view) {
                login();


    }


}